var handle_pic, handle;
$('*[nc_type="handle_image"]').unbind().each(function(){
	$(this).unbind();
	
	if($(this).find('img:first').prev().val() != ''){
		$(this).hover(function(){
			handle = $(this).find('*[nc_type="handle"]');
			handle.show();
			handle.hover(function(){
				set_zindex($(this), "999");
			},
			function(){
				set_zindex($(this), "0");
			});
			set_zindex($(this), '999');
		},
		function(){
			handle.hide();
			set_zindex($(this), '0');
		});
	}
});
$('span[nctype="delete_image"]').unbind().click(function(){
	$(this).parents('li')
		.find('img:first').attr('src','/image/default/user_admin/loading.gif')
		.end().find('*[nc_type="handle"]').hide()
		.end().find('input[type="hidden"]').val('')
		.end().find('img:first').attr('src','/image/default/nopicsmall.gif');
		$.getScript("/script/product.js");
});


	$('.show_big').unbind().hover(function(){
		var _left=$(this).offset().left;
		var _top =$(this).offset().top;
		var picNode = $(this).next().find('img');
		var picSrc = picNode.attr('src');
		var picKey = picNode.attr('picKey');
		var picSide = $('#pic_param_size_'+picKey).val();
		var picRight = $('#pic_param_right_'+picKey).val();
		var picBottom = $('#pic_param_bottom_'+picKey).val();
		if(picSide>0){
			var $$="http://wx.52ywy.com/Qrcode/showMix?pic="+encodeURIComponent(picSrc)+"&shop=14441&side="+picSide+"&right="+picRight+"&bottom="+picBottom;
		}else{
			var $$=picSrc;
		}
		$('<img id="biger_img" width="300" style="position:absolute;z-index:9999;left:'+(_left-(-11))+'px;top:'+(_top-(-11))+'px;"/>').attr('src',$$).appendTo($(document.body));
	},function(){
		$('#biger_img').remove();
	});


function set_zindex(parents, index){
    $.each(parents,function(i,n){
        if($(n).css('position') == 'relative'){
           $(n).css('z-index',index);
        }
    });
}